﻿@page "/Admin/TcpService"

@using BlazorAdmin.Models
@using BlazorAdmin.Tcp.Server
@using BlazorAdmin.Web.Shared.Components
@using Console = BootstrapBlazor.Components.Console

<Split IsVertical=true class="vertical-split console">
    <FirstPaneTemplate>
        <AdminTable TItem=DeviceTcpToken PageItemsSource=PageItemsSource ShowDefaultButtons=false ShowExtendButtons=false 
            ShowAdvancedSearch=false OnQueryAsync=OnQueryAsync OnExportAsync=OnExportAsync>
            <TableColumns>
                <TableColumn Text="设备ID" Field=@context.ID FieldName=@nameof(context.ID) Filterable=true Sortable=true Searchable=true />
                <TableColumn Text="连接端口" Field=@context.ClientPoint FieldName=@nameof(context.ClientPoint) Filterable=true Sortable=true Searchable=true />
                <TableColumn Text="连接时间" Field=@context.ConnectTime FieldName=@nameof(context.ConnectTime) Filterable=true Sortable=true Searchable=true FormatString=@SysConsts.FormatTime/>
                <TableColumn Text="活动时间" Field=@context.LastActivityTime FieldName=@nameof(context.LastActivityTime) Filterable=true Searchable=true Sortable=true FormatString=@SysConsts.FormatTime/>
            </TableColumns>
        </AdminTable>
    </FirstPaneTemplate>
    <SecondPaneTemplate>
        <div class="d-flex justify-content-center align-items-center" style="height: 300px;">
            <Console HeaderText=@SelectTokenStr LightTitle="TCP服务运行中" ShowAutoScroll=true Items=@Messages />
        </div>
    </SecondPaneTemplate>
</Split>